package com.anche.cywebnew.Controller.businessManager;

import com.anche.cywebnew.Pojo.businessManager.CyDataExceptionInfo;
import com.anche.cywebnew.Service.businessManager.CyDataExceptionService;
import com.anche.cywebnew.Utils.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/business/cyException")
public class CyDataExceptionController {

    @Autowired
    private CyDataExceptionService cyDataExceptionService;

    @GetMapping("/exceptionInfo")
    @ResponseBody
    public Object getExceptionInfo(@RequestParam("cylsh") String cylsh) {
        try {
            CyDataExceptionInfo cyDataExceptionInfo = cyDataExceptionService.getExceptionInfoByCylsh(cylsh);

            //List<CyDataExceptionInfo> cyDataExceptionInfos = cyDataExceptionService.getExceptionInfoByVideoId(id);
            return ResultUtil.success(cyDataExceptionInfo);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.error(0, e.getMessage());
        }
    }
}
